//
//  STWeekDaySelTimeCell.m
//  YiYueHairdresser
//
//  Created by 路人甲 on 2018/11/3.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "STWeekDaySelTimeCell.h"

@implementation STWeekDaySelTimeCell

-(void)setBtnName:(NSString *)name{
    [self.nameBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.nameBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
    self.nameBtn.layer.cornerRadius = 5;
    self.nameBtn.layer.masksToBounds = YES;
    self.nameBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.nameBtn.layer.borderWidth = 1;
    [self.nameBtn addTarget:self action:@selector(actionChangeWeekDay:) forControlEvents:UIControlEventTouchUpInside];
    
    self.arrowLab.textColor =[UIColor blackColor];
    self.detailLab.textColor =[UIColor blackColor];
    [self.nameBtn setTitle:name forState:UIControlStateNormal];
}


-(void)setWeekSelTime:(NSString *)selTime{
    self.detailLab.text =selTime;
}

-(void)actionChangeWeekDay:(UIButton *)sender{
    sender.selected = !sender.selected;
    [self setBtnBackColor:sender];
}

-(void)setBtnBackColor:(UIButton *)sender{
    if(sender.selected){
        sender.backgroundColor = [UIColor orangeColor];
        self.arrowLab.textColor =[UIColor orangeColor];
        self.detailLab.textColor =[UIColor orangeColor];
    }else{
        sender.backgroundColor = [UIColor whiteColor];
        self.arrowLab.textColor =[UIColor blackColor];
        self.detailLab.textColor =[UIColor blackColor];
    }
    
}

@end
